<?php
namespace app\bis\controller;
use think\Controller;
class Base extends  Controller
{
    /**
     * 商户表验证登录
     */
    public function _initialize() {
        $isLogin = $this->isLogin();
        if(!$isLogin) {
            return $this->redirect(url('login/index'));
        }
    }

    /*
     * 判断是否登录
     */
    public function isLogin() {
        //获取session
        $user = session('bisAccount', '', 'bis');
        if($user && $user->id) {
            return true;
        }
        return false;
    }


    /**
     * 获取登录商户信息
     */
    public function getLoginUser() {
        $user = session('bisAccount', '', 'bis');
        return $user;
    }

}
